// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Components/SplineComponent.h"
#include "Components/TimelineComponent.h"
#include "AnimatedActor.generated.h"

UCLASS()
class CLASS13_API AAnimatedActor : public AActor
{
	GENERATED_BODY()
	
public:	
	AAnimatedActor();

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Spline")
	USplineComponent* _spline;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Spline")
	UStaticMeshComponent* _mesh;

protected:
	virtual void BeginPlay() override;

	UCurveFloat* _curve;
	FTimeline _timeline;
	bool _reversed;

public:
	virtual void Tick(float DeltaTime) override;

	UFUNCTION()
	void OnTimelineProcess(float v);

	UFUNCTION()
	void OnTimelineDone();
};
